home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19950726-19950929 / 000115_news@columbia.edu_Wed Aug 9 15:50:18 1995.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA18867
  2.   (5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Wed, 9 Aug 1995 11:50:24 -0400
  3. Received: by apakabar.cc.columbia.edu id AA05855
  4.   (5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Wed, 9 Aug 1995 11:50:22 -0400
  5. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  6. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  7. Newsgroups: comp.protocols.kermit.misc
  8. Subject: Re: Remapping function keys?
  9. Date: 9 Aug 1995 15:50:18 GMT
  10. Organization: Columbia University
  11. Lines: 64
  12. Message-Id: <40alfq$5ms@apakabar.cc.columbia.edu>
  13. References: <3vlgqu$chj@n.ruf.uni-freiburg.de>
  14. Nntp-Posting-Host: watsun.cc.columbia.edu
  15. Cc: 
  16.  
  17. In article <3vlgqu$chj@n.ruf.uni-freiburg.de>,
  18. Christoph Gartmann <gartmann@immunbio.mpg.de> wrote:
  19. : Is it possible to remap the function keys to something different? The
  20. : problem here is that my system (C-Kermit under VMS) doesn't send a
  21. : single byte but several bytes for one function key. E.g. F10 sends
  22. : <ESC>[21~ . And now I would like C-Kermit to transmit something
  23. : different for F10. Is it possible? And if so, how do I do it?
  24. From the Kermit FAQ (http://www.columbia.edu/kermit/faq.html):
  25.  
  26. 24 HOW DO I USE 'SET KEY' WITH PC F-KEYS, ETC, IN UNIX OR VMS C-KERMIT?
  27.  
  28. C-Kermit comes in basically two varieties:
  29.  
  30.    - The version for OS/2 that had direct access to the keyboard and
  31.      screen, and therefore can see keyboard scan codes and so on, and can
  32.      do true terminal emulation.  Here you have comprehensive key mapping
  33.      ability.
  34.  
  35.    - The versions for UNIX, VMS, and so on, that do not have direct access
  36.      to the keyboard and screen, and rely on your console driver, terminal
  37.      window, external terminal emulator (such as MS-DOS Kermit), or actual
  38.      terminal to perform the terminal functions.
  39.  
  40. UNIX is an interesting case.  Traditionally, UNIX was accessed through a
  41. terminal that was plugged into a terminal port on a timesharing system.
  42. Thus, there is no keyboard and screen -- just a communication port.  In
  43. recent years, this type of access has been largely replaced by terminal
  44. servers, but there is still no keyboard and screen.  However, now that we
  45. have a plethora of PC-based UNIX varieties that run on workstations (PCs)
  46. that actually do have a keyboard and screen, it would seem to make sense
  47. that Kermit should be able to see all the keys.
  48.  
  49. Unfortunately, this is not the case.  Most varieties of UNIX do not let
  50. the application see the keyboard.  There is no kernel function called "get
  51. keyboard scan code".  There is only read(), and read() reads a character,
  52. not a multibyte scan code.  Thus, even if your console driver has
  53. programmed (say) your F1 key to send (say) ESC O P, Kermit will read three
  54. characters in succession, as if they were three keystrokes, not one.  It
  55. has no way of knowing that you pressed the F1 key.  As far Kermit knows,
  56. you pressed the Esc key, then the O key, then the P key.
  57.  
  58. Now perhaps Linux *does* have a system call to let an application at the
  59. keyboard.  But...
  60.  
  61.    - In what contexts does it work?  Only on the raw console?  In an xterm
  62.      window?  etc etc.
  63.  
  64.    - Does it require special privilege to execute?
  65.  
  66.    - What about all the other versions of UNIX that run on PCs -- FreeBSD,
  67.      SCO, Solaris/Intel, etc etc?
  68.  
  69.    - What about all the other versions of UNIX that run on non-PC
  70.      workstations -- SunOS, Solaris/Sparc, HP-UX, AIX, SGI, etc?
  71.  
  72. So the answer is, for now at least -- and as the documentation states --
  73. C-Kermit's SET KEY command in UNIX (and VMS, AOS/VS, VOS, etc) works only
  74. for keys that generate a single 8-bit value, 0..255.  Other types of
  75. mappings will have to be accomplished outside of Kermit by configuring
  76. your console driver, your xterm (e.g. with Xmodmap), and so on.
  77.  
  78. - Frank